<h1>Edit profile information</h1>
<!--<style>
	
	input:focus {
		content: ''
	}
</style>-->

<?php
    echo $this->Form->create('User', array('action' => 'edit_profile'));
    echo $this->Form->input('name');
	echo $this->Form->input('surname');
	echo $this->Form->input('email');
	echo $this->Form->input('password', array('label' => 'New password'));
	echo $this->Form->input('birthday', array('minYear' => date('Y')-70, 'maxYear' => date('Y')-16));
	echo $this->Form->input('birth_place', array('label' => 'Place of birth'));
    echo $this->Form->input('id_user', array('type' => 'hidden'));
    echo $this->Form->end('Save the information');
	
?>

<!-- ulpoad photo files -->

<!--
<?php 
echo $this->Form->input('Photo', array('enctype'=>"multipart/form-data", 'action'=>"edit_profile", 'method'=>"POST"));
?>
    <!-- MAX_FILE_SIZE must precede the file input field ->
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />
    <!-- Name of input element determines name in $_FILES array ->
    Send this file: <input name="file" type="file" />
    <input type="submit" value="Send File" />
</form> -->

<!--
<body><form action="upload.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 


<?php
	echo $this->Form->input('Photo', array('enctype'=>"multipart/form-data", 'action'=>"edit_profile", 'method'=>"POST"));
?>

<input type="submit" name="submit" value="Submit" />
</form></body>


<?php
if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg")
	|| ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)){
		
	if ($_FILES["file"]["error"] > 0){
		
		echo "Return Code: " . $_FILES["file"]["error"] . " ";
	}
	
	else
	{
		echo "Upload: " . $_FILES["file"]["name"] . " ";
		echo "Type: " . $_FILES["file"]["type"] . " ";
		echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb ";
		echo "Temp file: " . $_FILES["file"]["tmp_name"] . " "; 

		if (file_exists("upload/" . $_FILES["file"]["name"])){
			
			echo $_FILES["file"]["name"] . " already exists. ";
		}
		
		else{
			
			move_uploaded_file($_FILES["file"]["/home/theo/www/student-network-sdu/webroot/img/". $_FILES["file"]["name"]]);
			echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
		}
	}
}
else
{
echo "Invalid file";
}
?>-->
